package com.party.mobile.web.dto.crowdfund.output;

import com.alibaba.fastjson.annotation.JSONField;
import com.party.core.model.activity.CrowfundResources;
import com.party.core.model.counterfoil.Counterfoil;
import com.party.core.model.crowdfund.CrowdfundingBattleReport;
import com.party.core.model.crowdfund.ProjectGradation;
import com.party.core.model.crowdfund.ProjectWithAuthor;
import org.springframework.beans.BeanUtils;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 众筹项目输出视图
 * Created by wei.li
 *
 * @date 2017/2/17 0017
 * @time 9:51
 */
public class ProjectOutput {

    //项目编号
    private String id;

    //题目
    private String title;

    //图片
    private String pic;

    //发起时间
    private Date createDate;

    //发起者编号
    private String authorId;

    //发起者昵称
    private String authorName;

    //发起者照片
    private String authorLogo;

    //项目描叙
    private String describe;

    //目标筹集资金
    private Float targetAmount;

    //实际筹集资金
    private Float actualAmount;

    //剩余筹集资金
    private Float surplusAmount;

    //支持者数目
    private Integer favorerNum;

    //宣言
    private String declaration;

    //项目内容
    private String content;

    //报名相关
    private String applyRelated;

    //参赛标准
    private String matchStandard;

    //众筹项目编号
    private String targeId;

    //是不是自己的项目
    @JSONField(name = "isMy")
    private boolean isMy;

    //风格
    private String style;

    //众筹是否成功
    private Integer isSuccess;

    //众筹编号
    private String myProjectId;

    //项目发起者编号
    private String targetAuthorId;

    //众筹中人数
    private Integer beCrowdfundNum;

    //已经筹满人数
    private Integer crowdfundedNum;

    //是否已经截止
    @JSONField(name = "isClosed")
    private boolean isClosed;

    //公众号信息
    private Map<String,Object> publicInfo;

    // 项目报名截止时间
    private Date endTime;

    //资源编号
    private String sourceId ;

    //目标编号
    private String targetId ;

    //是否授权（0：否,1：是）
    private int isAuthorized ;

    // 跑马灯
    private List<CrowfundResources> picList;

    //当前众筹者以及筹满多少场
    private List<ProjectGradation> projectGradationList;

    // 海报路径
    private String posterUrl;

    //付款类型：0为普通众筹，1为直接付款众筹',
    private Integer payType;
    //我的付款类型：0为普通众筹，1为直接付款众筹',
    private Integer myPayType;

    //队伍名称
    private String teamName;
    //二维码
    private String qrcodeUrl;

    private Integer personalPopularPageState;//个人众筹页状态，0:显示所属主题报名人员,1:显示该项目报名人员,2:不显示

    private Integer personalRanking;//个人排行榜，0:显示全部人数,1:自定义显示人数,2:不显示

    private Integer strategyState;//众筹攻略:0显示，1不显示

    private Integer isProblem;//常见问题:1显示，0不显示

    // 项目二维码
    private String targetQrCode;
    //是否播放音乐(0否/是)
    private Integer isPlayMusic ;
    //音频url
    private String audioUrl ;
    // 多场活动  多个阶段 个人众筹页  是否显示查看按钮  1：显示，0：不显示
    private Integer view ;

    private Integer challengeState; // 是否继续挑战

    private Integer challengeShow; // 是否隐藏继续挑战,停止挑战  1：隐藏，0：不隐藏

    private Integer gradation; // 当前正在筹第几阶段

    private Integer joinNum;

    public Integer getJoinNum() {
        return joinNum;
    }

    public void setJoinNum(Integer joinNum) {
        this.joinNum = joinNum;
    }

    //众筹战报列表
    private List<CrowdfundingBattleReport> cbrList;

    //多票据
    private List<Counterfoil> counterfoils;

    public List<Counterfoil> getCounterfoils() {
        return counterfoils;
    }

    public void setCounterfoils(List<Counterfoil> counterfoils) {
        this.counterfoils = counterfoils;
    }

    public Integer getIsProblem() {
        return isProblem;
    }

    public void setIsProblem(Integer isProblem) {
        this.isProblem = isProblem;
    }

    public Integer getChallengeShow() {
        return challengeShow;
    }

    public void setChallengeShow(Integer challengeShow) {
        this.challengeShow = challengeShow;
    }

    public Integer getGradation() {
        return gradation;
    }

    public void setGradation(Integer gradation) {
        this.gradation = gradation;
    }

    public Integer getChallengeState() {
        return challengeState;
    }

    public void setChallengeState(Integer challengeState) {
        this.challengeState = challengeState;
    }

    public Integer getView() {
        return view;
    }

    public void setView(Integer view) {
        this.view = view;
    }

    public List<ProjectGradation> getProjectGradationList() {
        return projectGradationList;
    }

    public void setProjectGradationList(List<ProjectGradation> projectGradationList) {
        this.projectGradationList = projectGradationList;
    }

    public Integer getStrategyState() {
        return strategyState;
    }

    public void setStrategyState(Integer strategyState) {
        this.strategyState = strategyState;
    }

    // 返回前端字段 是否显示礼包 1：显示 0：不显示
    private Integer showGift;

    public Integer getPersonalPopularPageState() {
        return personalPopularPageState;
    }

    public void setPersonalPopularPageState(Integer personalPopularPageState) {
        this.personalPopularPageState = personalPopularPageState;
    }

    public Integer getPersonalRanking() {
        return personalRanking;
    }

    public void setPersonalRanking(Integer personalRanking) {
        this.personalRanking = personalRanking;
    }

    public String getQrcodeUrl() {
        return qrcodeUrl;
    }

    public void setQrcodeUrl(String qrcodeUrl) {
        this.qrcodeUrl = qrcodeUrl;
    }

    public String getTeamName() {
        return teamName;
    }

    public void setTeamName(String teamName) {
        this.teamName = teamName;
    }

    public Map<String, Object> getPublicInfo() {
        return publicInfo;
    }

    public void setPublicInfo(Map<String, Object> publicInfo) {
        this.publicInfo = publicInfo;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getAuthorName() {
        return authorName;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    public String getAuthorLogo() {
        return authorLogo;
    }

    public void setAuthorLogo(String authorLogo) {
        this.authorLogo = authorLogo;
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public Float getTargetAmount() {
        return targetAmount;
    }

    public void setTargetAmount(Float targetAmount) {
        this.targetAmount = targetAmount;
    }

    public Float getSurplusAmount() {
        return surplusAmount;
    }

    public void setSurplusAmount(Float surplusAmount) {
        this.surplusAmount = surplusAmount;
    }

    public Integer getFavorerNum() {
        return favorerNum;
    }

    public void setFavorerNum(Integer favorerNum) {
        this.favorerNum = favorerNum;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }


    public Float getActualAmount() {
        return actualAmount;
    }

    public void setActualAmount(Float actualAmount) {
        this.actualAmount = actualAmount;
    }

    public String getTargeId() {
        return targeId;
    }

    public void setTargeId(String targeId) {
        this.targeId = targeId;
    }

    public boolean isMy() {
        return isMy;
    }

    public void setMy(boolean my) {
        isMy = my;
    }

    public String getAuthorId() {
        return authorId;
    }

    public void setAuthorId(String authorId) {
        this.authorId = authorId;
    }

    public String getDeclaration() {
        return declaration;
    }

    public void setDeclaration(String declaration) {
        this.declaration = declaration;
    }

    public String getStyle() {
        return style;
    }

    public void setStyle(String style) {
        this.style = style;
    }

    public Integer getIsSuccess() {
        return isSuccess;
    }

    public void setIsSuccess(Integer isSuccess) {
        this.isSuccess = isSuccess;
    }

    public String getMyProjectId() {
        return myProjectId;
    }

    public void setMyProjectId(String myProjectId) {
        this.myProjectId = myProjectId;
    }

    public String getApplyRelated() {
        return applyRelated;
    }

    public void setApplyRelated(String applyRelated) {
        this.applyRelated = applyRelated;
    }

    public String getMatchStandard() {
        return matchStandard;
    }

    public void setMatchStandard(String matchStandard) {
        this.matchStandard = matchStandard;
    }

    public String getTargetAuthorId() {
        return targetAuthorId;
    }

    public void setTargetAuthorId(String targetAuthorId) {
        this.targetAuthorId = targetAuthorId;
    }

    public Integer getBeCrowdfundNum() {
        return beCrowdfundNum;
    }

    public void setBeCrowdfundNum(Integer beCrowdfundNum) {
        this.beCrowdfundNum = beCrowdfundNum;
    }

    public Integer getCrowdfundedNum() {
        return crowdfundedNum;
    }

    public void setCrowdfundedNum(Integer crowdfundedNum) {
        this.crowdfundedNum = crowdfundedNum;
    }

    public boolean isClosed() {
        return isClosed;
    }

    public void setClosed(boolean closed) {
        isClosed = closed;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getSourceId() {
        return sourceId;
    }

    public void setSourceId(String sourceId) {
        this.sourceId = sourceId;
    }

    public String getTargetId() {
        return targetId;
    }

    public void setTargetId(String targetId) {
        this.targetId = targetId;
    }

    public int getIsAuthorized() { return isAuthorized;}

    public void setIsAuthorized(int isAuthorized) { this.isAuthorized = isAuthorized;}

    public List<CrowfundResources> getPicList() {
        return picList;
    }

    public void setPicList(List<CrowfundResources> picList) {
        this.picList = picList;
    }

    /**
     * 转输出视图
     * @param projectWithAuthor 项目视图
     * @return 输出视图
     */
    public static ProjectOutput  transform(ProjectWithAuthor projectWithAuthor){
        ProjectOutput projectOutput = new ProjectOutput();
        BeanUtils.copyProperties(projectWithAuthor, projectOutput);
        return projectOutput;
    }

    public String getPosterUrl() {
        return posterUrl;
    }

    public void setPosterUrl(String posterUrl) {
        this.posterUrl = posterUrl;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public Integer getMyPayType() {
        return myPayType;
    }

    public void setMyPayType(Integer myPayType) {
        this.myPayType = myPayType;
    }

    public Integer getShowGift() {
        return showGift;
    }

    public void setShowGift(Integer showGift) {
        this.showGift = showGift;
    }

    public String getTargetQrCode() {
        return targetQrCode;
    }

    public void setTargetQrCode(String targetQrCode) {
        this.targetQrCode = targetQrCode;
    }

    public Integer getIsPlayMusic() {
        return isPlayMusic;
    }

    public void setIsPlayMusic(Integer isPlayMusic) {
        this.isPlayMusic = isPlayMusic;
    }

    public String getAudioUrl() {
        return audioUrl;
    }

    public void setAudioUrl(String audioUrl) {
        this.audioUrl = audioUrl;
    }

    public List<CrowdfundingBattleReport> getCbrList() {
        return cbrList;
    }

    public void setCbrList(List<CrowdfundingBattleReport> cbrList) {
        this.cbrList = cbrList;
    }
}
